//
//  FPAboutUsController.m
//  FinanceProject
//
//  Created by 陈显摆 on 2025/2/18.
//

#import "FPAboutUsController.h"
#import "FPProfileInfoController.h"

@interface FPAboutUsController ()

@property (weak, nonatomic) IBOutlet UILabel *titleLab;
@property (weak, nonatomic) IBOutlet UILabel *versionLab;
@property (weak, nonatomic) IBOutlet UILabel *netTitleLab;
@property (weak, nonatomic) IBOutlet UILabel *netLab;
@property (weak, nonatomic) IBOutlet UILabel *beianLab;
@property (weak, nonatomic) IBOutlet UIButton *profileBtn;

@end

@implementation FPAboutUsController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)initUI {
    
    [self setTitle:@"关于我们" style:(XYCustomNavigationStyleWhite) hiddenBackBtn:NO];
    
    self.view.backgroundColor = MAIN_VIEW_BACKGROUND_COLOR;
    
    self.titleLab.textColor = [UIColor hexColor:@"#3A3A3A"];
    self.versionLab.textColor = [UIColor hexColor:@"#6A6A6A"];
    self.netTitleLab.textColor = [UIColor hexColor:@"#000000"];
    self.netLab.textColor = [UIColor hexColor:@"#000000"];
    self.beianLab.textColor = [UIColor hexColor:@"#9A9A9A"];
    [self.profileBtn setTitleColor:MAIN_BLUE_COLOR forState:(UIControlStateNormal)];
    
    NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
    self.versionLab.text = [NSString stringWithFormat:@"版本号 %@", version];
    
    self.netLab.text = @"www.baokun-pub.com";
    
    [self.netLab addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(openNetwebAction)]];
    
#warning 备案号
    self.beianLab.text = @"Copyright @ 2025 广东宝坤网络小额贷款有限公司 版权所有\n粤ICP备2024337735号-7A";
}

- (void)openNetwebAction {
    
    NSURL *url = [NSURL URLWithString:self.netLab.text];
    
    // 确保 URL 可以被打开
    if ([[UIApplication sharedApplication] canOpenURL:url]) {
        
        [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
    }
    else {
        
        [self showText:@"无法打开该网页"];
    }
}


#pragma mark - 查看证照信息
- (IBAction)checkProfileInfoAction:(UIButton *)sender {
    
    FPProfileInfoController *vc = [[FPProfileInfoController alloc] init];
    
    [self.navigationController pushViewController:vc animated:YES];
}


@end
